package com.blog.wl2023.repository;

import com.blog.wl2023.entity.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;


/**
 * @author wule
 * @data 2023年08月15日22时
 * @description 与用户相关的sql方法
 */
@Repository
public interface RoleRepository extends JpaRepository<Role, Long> {
	@Query("SELECT r FROM Role r JOIN FETCH r.user u WHERE u.uuid = :uuid")
	Role findRoleByUserId(String uuid);

}